<?php

namespace Trawind\Events\Subscribers\Sale\Dispatch;

use Trawind\Events\Events\Inventory\Fulfillment\StoreFulfillmentEvent;
use Trawind\Remotes\Repositories\Sale\Dispatch\VehicleRepositoryEloquent;

class VehicleSubscriber
{
    private $businessType = \Trawind\Basics\Enums\BusinessType::SALE_DISPATCH_VEHICLE;


	public function UpdateTransportedVehicle($event)
    {
        app(VehicleRepositoryEloquent::class)->callback($event->payload, StoreFulfillmentEvent::class);
    }

    /**
     *
     * @param  \Illuminate\Events\Dispatcher  $events
     */
    public function subscribe($events)
    {
		$events->listen(
            StoreFulfillmentEvent::class,
            static::class . '@UpdateTransportedVehicle'
        );

    }
}
